import request from "../request.js";
import url from "../../url/url.js";


export default {
    carList(data = {}) {
        return request({
            url: url.baseUrl + "/cmsBasket/list",
            data: data,
            method: "post"
        });
    },
    deleteCar(data = {}) {
        return request({
            url: url.baseUrl + "/cmsBasket/delete",
            data: data,
            method: "post"
        });
    },
    saveCollect(data = {}) {
        return request({
            url: url.baseUrl + "/collect/save",
            data: data,
            method: "put"
        });
    },
    /**
     * 添加作品到购物车
     * @param {}} data 
     * @returns 
     */
    addCar(data = {}) {
        return request({
            url: url.baseUrl + "/cmsBasket/add",
            data: data,
            method: "post"
        });
    },

    /**
     *购买记录 
     */
    orderPage(data, page) {
        return request({
            url: url.baseUrl + "/order/page?pageSize=" + page.pageSize + "&pageNum=" + page.pageNum,
            data: data,
            method: "post"
        });
    },

    /**
     *购买记录
     */
    pay(data) {
        return request({
            url: url.baseUrl + "/order/pay",
            data: data,
            method: "post"
        });
    },

    /**
     * 添加授权信息
     */
    authorizationSave(data) {
        return request({
            url: url.baseUrl + "/authorization/save",
            data: data,
            method: "put"
        });
    },

    /**
     *订单详情
     */
    orderInfo(id) {
        return request({
            url: url.baseUrl + "/order/" + id,
            method: "get"
        });
    },

}